<?php
	include 'ZionHeader.inc';
?>

<html>
<body>
<h1>Deleted Announcement!</h1>

<?php
$VehicleID = $_POST['ID'];

//echo $VehicleID;

include 'DatabaseConnect.inc';


$queryN = "DELETE FROM Notification WHERE VehicleID=".$VehicleID;
mysql_query($queryN);

$queryA = "DELETE FROM Announcement WHERE vehicle_ID=".$VehicleID;
mysql_query($queryA);

$queryI = "DELETE FROM imageTable WHERE VID=".$VehicleID;
mysql_query($queryI);

$queryC = "DELETE FROM Comment WHERE VehicleID=".$VehicleID;
mysql_query($queryC);

$queryV = "DELETE FROM Vehicle WHERE ID='".$VehicleID."'";
mysql_query($queryV);

//$query = "SELECT * from Vehicle WHERE VIN = '$Vin'";

//$result = mysql_query($query);
//$row = mysql_fetch_array($result);

//$username = $_SESSION['UName'];

//$time = date(DATE_RFC822);

//$query = "Alter Announcement ( Timestamp, vehicle_ID, userID) Values ('$time', '".$row['ID']."', '$username')";

//mysql_query($query);

mysql_close();

?>

<h1>Announcement has been deleted!</h1>
<br />
<br />
<a href="announcement.php">Return To Index</a>


</body>
</html>

